<template>
	<view>
		<uni-nav-bar dark :fixed="true" shadow background-color="rgb(107,60,94)" status-bar left-icon="left"
			left-text="返回" title="签到和签退" @clickLeft="back" />
		<view class="example-body">
			<uni-title title="请选择签退或暂离:" type="h1"></uni-title>
			<view class="scan">
				<image src="../../../static/成功.png" mode="aspectFit" class="scan"></image>
			</view>
			<button type="primary" @click="scanCode()" class="btnnot">点击扫码签到</button>
			<button type="default"class="btn">点击签退</button>
			<button type="default"class="btn">点击暂时离开</button>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods: {
			scanCode() {
				// 允许从相机和相册扫码
				uni.scanCode({
					success: function(res) {
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
					}
				});
				
			},
			back() {
				uni.navigateBack({
					delta: 1
				})
			}
		}
	}
</script>

<style>
	.example-body {
		padding: 12px;
		background-color: #FFFFFF;
	}
	.btn {
		background-color: rgb(107, 60, 94);
		color: white;
		margin-top: 50rpx;
	}
	.btnnot{
		background-color: rgb(171, 128, 176);
		color: white;
		margin-top: 50rpx;
	}
	.scan{
		margin-left: 20%;
		width: 60%;
	}
	
	
</style>
